  //自定义的tip效果组件
  Vue.component('tip-preview-image',{
    props:['row'],
    data : function() {
      return {
        dialogFormVisible:true,
        form:{},
        imageList:[],
      };
    },
    methods:{
      handelShow:function(){
        // console.log('show methods',this.row.imageSrc);
        this.imageList = this.row.imageSrc || [];
      },
    },
    template: `
      <el-popover v-if="row.imageSrc" trigger="hover" placement="top" @show="handelShow">
        <p v-for="(image, key) in imageList" style="display:inline-block;width:260px;">
          <img :src="image.path" style='max-height:260px;max-width:96%;'>
        </p>
        <div slot="reference" class="name-wrapper">
          <el-tag size="medium"><i class='el-icon-picture-outline'></i></el-tag>
        </div>
      </el-popover>
    `,
  });

callbacks['FuncIsover'] = function(row,options) {
    var tipTitle = row.isSample == 1 ? '确认下架吗' : '确认上架吗';
    this.$confirm(tipTitle, '提示', {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning'
    }).then(() => {
      var url = "<{url controller=$smarty.get.controller action='IsSample'}>";
      var params = {id:row.id};
      this.$http.post(url,params).then((res)=>{
        if(!res.data.success) {
          this.$message(res.data.msg||'操作失败','error');
          // console.log(res);
          return false;
        }
        this.$message(res.data.msg||'操作成功','success');
        //刷新grid
        this._getRows();
        return;
      }).catch((error)=>{
        //服务器端返回success=false
        console.error(error);
      });
    }).catch(() => {
      //请求失败
      return false;
    });
}
